# -*- coding: utf-8 -*-
# @Time    : 2023/6/2 14:44
# @Author  : Pan
# @Software: PyCharm
# @Project : VisualFramework
# @FileName: __init__.py

import paddle
from networks.Clas.ResNet import ResNet


def clas(config):
    model = eval(config["type"])(config)
    if "pretrained" in config and config["pretrained"] is not None:
        model.set_state_dict(paddle.load(config["pretrained"]))
    return model
